<template>
	<view class="wpprs">
		<view class="my">
			<view class="touxiang"><image :src="avatarUrl" mode=""></image></view>
			<view class="title">
				<view class="name">{{ userinfo.name }}</view>
				<view class="sf">{{ userinfo.level }}</view>
			</view>
		</view>
		<view class="boxs">
			<view class="content" @click="topage('报修', 2, 1)">
				<image src="../../static/images/iconEngineerFixOrder.png" mode=""></image>
				<view class="mylabel">我的报修派单</view>
				<view class="icon">></view>
			</view>
			<view class="content" @click="topage('安装', 1, 1)">
				<image src="../../static/images/iconEngineerInstallOrder.png" mode=""></image>
				<view class="mylabel">我的安装派单</view>
				<view class="icon">></view>
			</view>
			<view class="content" @click="topage('巡检', 3, 1)">
				<image src="../../static/images/iconEngineerInspectionOrder.png" mode=""></image>
				<view class="mylabel">我的巡检派单</view>
				<view class="icon">></view>
			</view>
			<view class="content" @click="topage('校验', 5, 1)">
				<image src="../../static/images/iconItemRecord.png" mode=""></image>
				<view class="mylabel">我的校验派单</view>
				<view class="icon">></view>
			</view>
			<view class="content" @click="topage('验证', 6, 1)">
				<image src="../../static/images/iconCompanyInfo.png" mode=""></image>
				<view class="mylabel">我的验证派单</view>
				<view class="icon">></view>
			</view>
			<view class="content upx" @click="topage('培训', 7, 1)">
				<image src="../../static/images/iconItemMiddleManager.png" mode=""></image>
				<view class="mylabel">我的培训派单</view>
				<view class="icon">></view>
			</view>
			<view class="content upx" @click="topage('移机', 8, 1)">
				<image src="../../static/images/iconEngineerInstallOrder.png" mode=""></image>
				<view class="mylabel">我的移机派单</view>
				<view class="icon">></view>
			</view>
		</view>
		<view class="boxs">
			<view class="content upx" @click="baoxiu">
				<image src="../../static/images/iconEngineerFix.png" mode=""></image>
				<view class="mylabel">报修</view>
				<view class="icon">></view>
			</view>
		</view>
		<view class="boxs">
			<view class="content" @click="topages('安装', 1, 2)">
				<image src="../../static/images/iconEngineerInstallRecord.png" mode=""></image>
				<view class="mylabel">安装记录</view>
				<view class="icon">></view>
			</view>
			<view class="content" @click="topages('报修', 2, 2)">
				<image src="../../static/images/iconEngineerFixRecord.png" mode=""></image>
				<view class="mylabel">维修记录</view>
				<view class="icon">></view>
			</view>
			<view class="content" @click="topages('巡检', 3, 2)">
				<image src="../../static/images/iconEngineerInspectionRecord.png" mode=""></image>
				<view class="mylabel">巡检记录</view>
				<view class="icon">></view>
			</view>
			<view class="content" @click="topages('校验', 5, 2)">
				<image src="../../static/images/iconItemStructure.png" mode=""></image>
				<view class="mylabel">校验记录</view>
				<view class="icon">></view>
			</view>
			<view class="content" @click="topages('验证', 6, 2)">
				<image src="../../static/images/iconItemLaboratory.png" mode=""></image>
				<view class="mylabel">验证记录</view>
				<view class="icon">></view>
			</view>
			<view class="content" @click="topages('培训', 7, 2)">
				<image src="../../static/images/iconItemHead.png" mode=""></image>
				<view class="mylabel">培训记录</view>
				<view class="icon">></view>
			</view>
			<view class="content upx" @click="topages('移机', 8, 2)">
				<image src="../../static/images/iconEngineerInstallRecord.png" mode=""></image>
				<view class="mylabel">移机记录</view>
				<view class="icon">></view>
			</view>
		</view>
		<view class="boxs">
			<view class="content upx" @click="statistics">
				<image src="../../static/images/iconEngineerStatistics.png" mode=""></image>
				<view class="mylabel">统计</view>
				<view class="icon">></view>
			</view>
		</view>
		<view class="boxs">
			<view class="content upx" @click="tohelp">
				<image src="../../static/images/iconEngineerHelp.png" mode=""></image>
				<view class="mylabel">帮助</view>
				<view class="icon">></view>
			</view>
		</view>
		<view class="bactop" @click="bactop">《用户注册及使用app隐私协议》</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			userinfo: {},
			avatarUrl: ''
		};
	},
	onShow() {
		this.subscriptionsMsg();
	},
	created() {
		this.userinfo = uni.getStorageSync('userinfo');
		// 获取用户信息
		let _this = this;
		uni.getUserInfo({
			provider: 'weixin',
			success: function (infoRes) {
				let userInfo = infoRes.userInfo;
				_this.avatarUrl = userInfo.avatarUrl;
				// console.log('userInfo', userInfo);
			}
		});
	},
	methods: {
		tohelp() {
			uni.navigateTo({
				url: `/pages/help/help`
			});
		},
		statistics() {
			uni.navigateTo({
				url: `/pages/statistics/statistics`
			});
		},
		bactop() {
			uni.navigateTo({
				url: `/pages/privacyagreement/privacyagreement`
			});
		},
		baoxiu() {
			uni.navigateTo({
				url: `/pages/reportforrepair/reportforrepair`
			});
		},
		topages(name, type, listtype) {
			uni.navigateTo({
				url: `/pages/historylist/historylist?name=${name}&type=${type}&listtype=${listtype}`
			});
		},
		topage(name, type, listtype) {
			uni.navigateTo({
				url: `/pages/my/repairdispatch/repairdispatch?name=${name}&type=${type}&listtype=${listtype}`
			});
		}
	}
};
</script>

<style lang="less" scoped>
.wpprs {
	background: url('https://junminyiqi.oss-cn-shanghai.aliyuncs.com/flies/d29eccf2-f7be-dbc8-4853-e3b19055825b.png');
	background-repeat: no-repeat;
	background-size: 100%;
	min-height: 600upx;
	padding: 0upx 30upx;
	.bactop {
		font-size: 22upx;
		text-align: center;
		padding-top: 30upx;
		text-decoration: underline;
	}
	.my {
		overflow: hidden;
		padding: 60upx 40upx;
		.touxiang {
			float: left;
			padding: 2px;
			border-radius: 50%;
			image {
				width: 120upx;
				height: 120upx;
				border-radius: 50%;
				background-image: url('http://junminyiqi.oss-cn-shanghai.aliyuncs.com/images/iconLoginBg-MZ0omDtB4LHR.png');
				background-size: 100%;
			}
		}
		.title {
			float: left;
			color: #fff;
			.name {
				font-size: 36upx;
				padding: 14upx 30upx;
			}
			.sf {
				font-size: 24upx;
				padding-left: 30upx;
			}
		}
	}
	.boxs {
		background: #ffffff;
		box-shadow: 0px 16px 32px 0px rgba(0, 0, 0, 0.05);
		border-radius: 20upx;
		margin-top: 30upx;
		.content {
			display: flex;
			padding: 30upx 30upx;
			border-bottom: 1px rgba(0, 0, 0, 0.05) solid;
			&.upx {
				border: none;
			}
			image {
				width: 40upx;
				height: 40upx;
				transform: translateY(4upx);
			}
			.mylabel {
				padding-left: 20upx;
				width: 100%;
			}
			.icon {
			}
		}
	}
}
</style>
